package com.bops.service;

import java.util.List;

import com.bops.dal.order.dao.OrderDAO;
import com.bops.dal.order.dataobject.OrderInfoDO;
import com.bops.dal.order.queryobject.OrderInfoQuery;

public class OrderService {

	OrderDAO orderDAO;
	public static final String WAIT_CHECK = "待处理";
	public static final String PAIED = "已付款";
	public static final String CLOSE = "关单";
	public static final String OVER = "作废";

	public Integer insert(OrderInfoDO orderDO) {
		orderDO.setStatus(WAIT_CHECK);
		return orderDAO.insert(orderDO);
	}

	public boolean update(OrderInfoDO orderDO) {
		return orderDAO.update(orderDO);
	}

	/**
	 * 检查更新
	 * 
	 * @param orderDO
	 * @return
	 */

	public OrderInfoDO getById(Integer id) {
		return orderDAO.getById(id);
	}

	public List<OrderInfoDO> listOrder(OrderInfoQuery query) {
		return orderDAO.listOrder(query);
	}

	public boolean delete(Integer id) {
		return orderDAO.delete(id);
	}

	public Integer maxOrderID() {
		return orderDAO.maxOrderID();
	}

	public void setOrderDAO(OrderDAO orderDAO) {
		this.orderDAO = orderDAO;
	}

}
